package com.exam.controller;

import com.exam.pojo.entity.Position;
import com.exam.service.PositionService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("position")
public class PositionController {
    @Resource
    private PositionService positionService;

    @RequestMapping("findPositionListByDepartmentId/{departmentId}")
    public String findPositionListByDepartmentId(@PathVariable("departmentId") Integer departmentId, Model model){
        List<Position> positionList = positionService.findPositionListByDepartmentId(departmentId);
        System.out.println(positionList);
        model.addAttribute("positionList",positionList);
        return "user-add";
    }

}
